<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="../assets/js/vue.js"></script>
    <title>v-model</title>
</head>
<body>
    <div id="app">
        <p>原始文本信息：{{message}}</p>
        <h3>文本框</h3>
        <p>v-model:<input type="text" v-model="message"></p>
        <p>v-model.lazy:<input type="text" v-model.lazy="message"></p>
        <p>v-model.number:<input type="text" v-model.number="message"></p>
        <p>v-model.trim:<input type="text" v-model.trim="message"></p>

        <hr>
        <p>原始文本信息：{{nextMes}}</p>
        <textarea cols="30" rows="10" v-model="nextMes"></textarea>
        <hr>
        <br>

        <h3>多选按钮绑定一个值</h3>
        <input type="checkbox" id="isTrue" v-model="isTrue">
        <label for='isTrue'>{{isTrue}}</label>
        <hr>

        <h3>多选绑定一个数组</h3>
       <p>
            <input type="checkbox" id="JSPang" value="JSPang" v-model="web_Names">
            <label for="JSPang">JSPang</label><br/>
            <input type="checkbox" id="Panda" value="Panda" v-model="web_Names">
            <label for="JSPang">Panda</label><br/>
            <input type="checkbox" id="PanPan" value="PanPan" v-model="web_Names">
            <label for="JSPang">PanPan</label>
            <p v-for="names in web_Names">你有时候叫{{names}}</p>
       </p>

       <h3>单选按钮绑定数据</h3>
       <p>
        man<input type="radio" id="myGender" value="man" v-model="sex">
        <br>
        woman<input type="radio" id="myGender" value="woman" v-model="sex">
        <p>your gender is {{sex}}</p>
       </p>
        
    </div>



    <!--.lazy：取代 imput 监听 change 事件。
        number：最先输入的是字符则失效，最先输入数字则后边不能输入字符。
        trim：输入去掉首尾空格。-->
    <script>
        var app=new Vue({
            el:'#app',
            data:{
                message:'hello Vue!',
                nextMes:'rock you!',
                isTrue:true,
                web_Names:[],
                sex:''
            }
        })
    </script>
    
</body>
</html>